package net.gxnun.xiaoyuan.core.message.handler.impl;

import java.util.Date;

import net.gxnun.xiaoyuan.core.message.handler.MessageHandler;
import net.gxnun.xiaoyuan.core.message.request.RequestMsg;
import net.gxnun.xiaoyuan.core.message.request.TextMsg;
import net.gxnun.xiaoyuan.core.message.response.ResponseModel;
import net.gxnun.xiaoyuan.core.message.response.ResponseTextMsg;
import net.gxnun.xiaoyuan.core.share.MsgType;

import org.springframework.stereotype.Component;

@Component
public class MenuMessageHandler implements MessageHandler{

    @Override
    public ResponseModel handler(RequestMsg msg) {
        TextMsg tmsg = (TextMsg)msg;
        ResponseTextMsg rmsg = new ResponseTextMsg();
        rmsg.setContent("您进入了目录，请输入内容！");
        rmsg.setCreateTime(new Date().getTime()+"");
        rmsg.setFromUserName(tmsg.getToUserName());
        rmsg.setFuncFlag("");
        rmsg.setMsgType(MsgType.Text);
        rmsg.setToUserName(tmsg.getFromUserName());
        ResponseModel model = new ResponseModel();
        model.setValue(rmsg);
        return model;
    }

}
